//
//  WBDemoViewController.swift
//  传智新浪微博
//
//  Created by app on 17/6/1.
//  Copyright © 2017年 app. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {


    override func viewDidLoad() {
        super.viewDidLoad()

        // 设置标题
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个"
    }
    
    
    // MARK: - 监听方法
    // 继续 push 一个新的控制机器
    @objc func showNext() {
        
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
        
    }

}


extension WBDemoViewController {
    
    override func setupTableView() {
        super.setupTableView()

        // 设置右侧的控制器        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", targrt: self, action: #selector(showNext))
    }
}
